import unittest
from time import sleep
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import Login

class mytest03(unittest.TestCase):
    def setUp(self):
        self.driver =Login.login()
    def test_zhengxiang_02(self):
        self.driver.find_element('link text', '电子邮件').click()
        sleep(1)
        self.driver.find_element('link text','邮箱配置').click()
        self.driver.switch_to.default_content()
        ele2 = self.driver.find_element('css selector', '#iframe_main')
        self.driver.switch_to.frame(ele2)
        self.driver.find_element('css selector','.f-toolbar > div:nth-child(1) > button:nth-child(1)').click()
        self.driver.switch_to.default_content()
        ele1= self.driver.find_element('css selector', '.d-content > iframe:nth-child(1)')
        self.driver.switch_to.frame(ele1)
        self.driver.find_element('id','code').send_keys('12311')
        self.driver.find_element('id','accountName').send_keys('96142220')
        self.driver.find_element('id','email').send_keys('961428220@qq.com')
        self.driver.find_element('id','userName').send_keys('admin')
        self.driver.find_element('id','password').send_keys('sys123456')
        self.driver.find_element('id','pop3url').send_keys('pop.enample.com')
        self.driver.find_element('id','smtpUrl').send_keys('smtp.exalple.com')
        self.driver.find_element('id','button_save').click()
        sleep(2)
    def tearDown(self) -> None:
            self.driver.close()

if __name__ == '__main__':
        unittest.main()